package top.tagao.yygh.common.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import top.tagao.yygh.common.result.Result;

/**
 * @author fu-xiao-liu
 * @Date 2022/2/24 22:57
 */
@RestControllerAdvice
public class globalExceptionHandler {
        @ExceptionHandler(Exception.class)
        public Result error(Exception e) {
                e.printStackTrace();
                return Result.fail();
        }

        @ExceptionHandler(YyghException.class)
        public Result error(YyghException e) {
                e.printStackTrace();
                return Result.fail();
        }
}
